package com.sanmu.shop.util;

/** 
* @ClassName: UserException 
* @Description: 自定义异常类 
* @author lilj
* @date 2018年4月15日 下午11:36:53 
*/
@SuppressWarnings("serial")
public class UserException extends RuntimeException {

	private String errorCode;
	private String errorMessage;
	
	public UserException(){

	}
	
	public UserException(String errorMessage){
		super(errorMessage);
		this.errorMessage = errorMessage;
	}

	public UserException(ResultEnum resultEnum){
		super(resultEnum.getMessage());
		this.errorCode = resultEnum.getCode();
		this.errorMessage = resultEnum.getMessage();
	}
	public UserException(String errorCode, String errorMessage){
		super(errorMessage);
		this.errorCode = errorCode;
		this.errorMessage = errorMessage;
	}
	public UserException(String errorMessage, Throwable throwable){
		super(errorMessage,throwable);
		this.errorMessage = errorMessage;
	}
	
	public UserException(String errorCode, String errorMessage, Throwable throwable){
		super(errorMessage,throwable);
		this.errorCode = errorCode;
		this.errorMessage = errorMessage;
	}
	
	public String getErrorCode() {
		return errorCode;
	}
	
	public void setErrorCode(String errorCode) {
		this.errorCode = errorCode;
	}
	
	public String getErrorMessage() {
		return errorMessage;
	}
	
	public void setErrorMessage(String errorMessage) {
		this.errorMessage = errorMessage;
	}
}
